<template>
  <h1>我是Hello组建的标题</h1>
  <p>Count组件传过来的参数:{{ count }}</p>
</template>

<script>
import MyBus from "../MyBus";
import { ref } from "@vue/reactivity";
export default {
  name: "Hello",
  setup() {
    let count = ref("");

    // 定义函数
    MyBus.on("savePrice", (value) => {
      count.value = value;
    });
    return {
      count,
    };
  },
};
</script>

<style>
</style>